package user;

import book.BookList;
import operations.IOperation;

public abstract class User {
    protected String name;

    protected IOperation[] iOperations;
    public User(String name){
        this.name=name;
    }

    public abstract int menu();

    //test中生成对象的时候已经生成了iOperation的值,所以不会混淆对象的操作数组
    public void doOperation(int choice , BookList bookList) {
        //不发生多态，是操作对象调用自己的work方法
        iOperations[choice].work(bookList);
    }
}
